package com.awakening.o2o.enums;

/**
 * @Author:AwakeningCode
 * @Date: Created in 14:56 2018\2\4 0004
 */
public enum ShopAuthMapStateEnum {
    SUCCESS(1,"操作成功"),INNER_ERROR(-1001,"操作失败"),NULL_SHOPAUTH_ID(-1002,"ShopAuthId为空"),NULL_SHOPAUTH_INFO(-1003,"传入空的信息");
    private int state;

    private String stateInfo;

    private ShopAuthMapStateEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    public int getState() {
        return state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public static ShopAuthMapStateEnum stateOf(int index) {
        for (ShopAuthMapStateEnum state : values()) {
            if (state.getState() == index) {
                return state;
            }
        }
        return null;
    }
}
